import { message } from 'antd';
import axios, { AxiosResponse } from 'axios';
import { baseURL } from '../config/configFile';
import Response from '../types/Response';

// axios实例
const axiosInstance = axios.create({
    baseURL
})

//请求关于页面内容
export async function queryAbout(): Promise<string | null> {
    try {
        const { data }: AxiosResponse<Response<string>> = await axiosInstance.get('/queryAbout');
        if (!!data.success) {
            return data.data;
        } else {
            message.warning(data.message);
            return null;
        }
    }
    catch (e) {
        message.error('网络错误');
        return null;
    }
}